home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXT Education Software Sampler 1992 Fall
/
NeXT Education Software Sampler 1992 Fall.iso
/
Demos
/
DE_MesaAR1
/
Examples
/
AddIn
/
Inc.m
< prev
next >
Wrap
Text File
|
1992-05-25
|
2KB
|
47 lines
/**************************************************************************
* *
* *
* This code is copyright (c) 1992 *
* Athena Design, Inc. *
* and David Pollak *
* *
* ALL RIGHTS RESERVED *
* *
* *
* *
* *
* *
**************************************************************************/
#import "Inc.h"
#import <libc.h>
@implementation IncAddIn
+ (char *)name
{
return "INC";
}
- execute:(void *)stack numberOfParams:(int)num sheet:(void *)sh
{
AddInValue aiv;
double n = 0;
int error = noError;
initAddInValue(&aiv);
if (num != 1) pushErrorOnStack(stack,badFormulaError);
else {
popValueFromStack(stack,&aiv);
n = getAddInValueNumber(&aiv,&error);
if (error != noError) pushErrorOnStack(stack,error);
else pushNumberOnStack(stack,n + 1);
}
freeAddInValue(&aiv);
return self;
}
@end